<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('菜房入库单详情列表')"/>
    <style>
        .fixed-table-toolbar .bs-bars {
            width: 100%;
        }
    </style>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" id="printArea">
        <div class="col-sm-12 search-collapse">

            <form id="formId">
                <input type="hidden" name="orderId" th:value="${orderId}">
                <div class="select-list">

                    <ul>
                       <!-- <li>
                            <h3 class="inline">订单编号：</h3>
                        </li>
-->
                        <li class="select-time">
                            <label>入库时间： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]" lay-key="1" th:value="${beginxdTime}">
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]" lay-key="2" th:value="${endxdTime}">
                        </li>

                        <li>
                            入库经手人：<input type="text" name="inputUser"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <h3 align="center"><span th:text="入库单" id="ordercode" hidden="hidden"></span></h3>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
            <h3><span class="fl-l" id="autograph" hidden="hidden"></span></h3>
        </div>

        <div class="btn-group-sm" id="toolbar1" role="group">

            <a class="btn btn-warning" onclick="$.table.exportExcel()">
                <i class="fa fa-download"></i> 导出
            </a>
            <a class="btn btn-warning" id="print-btn" orderType="7">
                <i class="fa fa-download"></i> 打印
            </a>
            <!--            <div></div>-->
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncInputCf:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncInputCf:remove')}]];
    var prefix = ctx + "system/ncInputCf";
    var datas = [[${@dict.getType('check_result')}]];
    var cforderType = [[${@dict.getType('cforderType')}]];
    $(function () {
        var options = {
            url: prefix + "/list?orderId="+[[${orderId}]],
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export?orderId="+[[${orderId}]],
            modalName: "菜房入库",
            toolbar: 'toolbar1',
            striped: true,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            showExport: false,
            columns: [
                {
                    field: 'inputId',
                    title: '入库id',
                    visible: false
                }, {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },{
                    field: 'ncorderCf.cforderCode',
                    title: '订单编号',
                    formatter: function (value, row, index) {
                        if (row.ncorderCf.isCheck == '1') {
                            return '--'
                        } else {
                            return row.ncorderCf.cforderCode
                        }

                    }

                }, {

                    field: 'piciCode',
                    title: '蔬菜批次',
                },
                {
                    field: 'cropNameCn',
                    title: '作物名称',
                },
                {
                    field: 'cropVarietiesCn',
                    title: '作物品种',
                },
                {
                    field: 'teamCn',
                    title: '生产班组',

                },
                {
                    field: 'ncorderCf.cforderType',
                    title: '入库类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(cforderType, value);
                    }
                },
                {
                    field: 'inputAmout',
                    title: '入库数量（kg）',
                    sortable: true
                },
                {
                    field: 'leftAmount',
                    title: '剩余量',
                    sortable: true
                },
                {
                    field: 'boxAmount',
                    title: '框数',
                    sortable: true
                },
                {
                    field: 'inputTime',
                    title: '入库时间',
                    sortable: true
                },
                {
                    field: 'inputUser',
                    title: '入库经手人',
                    sortable: true
                },

                {
                    field: 'remark',
                    title: '备注',
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inputId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inputId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

        $('.top-link').click(function () {
            var index = $(this).index();
            switch (index) {
                case 0:
                    window.location.href = ctx + 'system/ncOrderCf/ncOrderCf-ordered?status=2';
                    return;
                case 1:
                    window.location.href = ctx + 'system/ncInputCf';
                    return;
                case 2:
                    window.location.reload();
                    return;
                case 3:
                    window.location.href = ctx + 'system/ncOuputCf';
                    return;
            }
        })
    });
</script>
</body>
</html>